import time
from selenium import webdriver
# 打开浏览器
driver = webdriver.Chrome()
driver.get("https://www.baidu.com")
driver.maximize_window()
# 添加和登录相关的cookie
cookies = [
    {'name': 'BUDSS',
     'value': 'xxx'},
    {'name': 'BDUSS_BFESS',
     'value': 'xxx'}
]
for i in cookies:
    driver.add_cookie(i)   # 遍历添加cookie

# 刷新页面
driver.refresh()
# 关闭浏览器
time.sleep(2)
driver.quit()
